using System;
using UnityEngine;
namespace RuntimeCommand { 
public interface Command
{
    void Execute(params object[] param);
}
public class CommandID : Attribute
{
    public string id;
    public string information;
    public CommandID(string _id, string info = "")
    {
        id = _id;
        information = info;
    }
}
[CommandID("help", "View all commands")]
public struct Cmd_Help : Command
{
    public void Execute(params object[] param)
    {
        if (param.Length == 0)
        {
            CommandController.current.showHistory = true;
            CommandController.current.AddHelp();
        }

    }
}
[CommandID("history", "Close history window/empty window  param:  close/clear/open")]
public struct Cmd_History : Command
{
    public void Execute(params object[] param)
    {
        if (param.Length == 0)
        {
            return;
        }
        if (param[0].ToString() == "close")
        {
            CommandController.current.showHistory = false;
        }
        else if (param[0].ToString() == "clear")
        {
            CommandController.current.historyContent.Clear();
        }
        else if (param[0].ToString() == "open")
        {
            CommandController.current.showHistory = true;
        }
    }
}
}